//
//  TRWeiboUtils.m
//  TLBS
//
//  Created by tarena on 14-3-29.
//  Copyright (c) 2014年 tarena. All rights reserved.
//

#import "TRWeiboUtils.h"
#import "TRMyRequest.h"
@implementation TRWeiboUtils
-(void)addFriend:(NSString *)userName withListID:(NSString *)listid{
    TRMyRequest *request = [[TRMyRequest alloc]init];
    [self.requests addObject:request];
    
    NSMutableDictionary *params = [NSMutableDictionary dictionaryWithObject:@"json" forKey:@"format"];
    [params setObject:listid forKey:@"listid"];
    [params setObject:userName forKey:@"names"];
    [request requestWithParams:params apiName:@"list/add_to_list" httpMethod:@"POST" :^(NSString *jsonString) {
        NSLog(@"添加好友：%@",jsonString);
        [self.requests removeObject:request];
    }];

}

-(void)deleteFriend:(UserInfo *)userInfo withListID:(NSString *)listid{
    TRMyRequest *request = [[TRMyRequest alloc]init];
    [self.requests addObject:request];
    
    NSMutableDictionary *params = [NSMutableDictionary dictionaryWithObject:@"json" forKey:@"format"];
       [params setObject:listid forKey:@"listid"];
    [params setObject:userInfo.name forKey:@"names"];
    [request requestWithParams:params apiName:@"list/del_from_list" httpMethod:@"POST" :^(NSString *jsonString) {
        NSLog(@"删除好友：%@",jsonString);
        [self.requests removeObject:request];
    }];

    
    
}

@end
